/*
 * TCM8230.h
 *
 *  Created on: 2011/09/21
 *      Author: AKS
 */

#ifndef _TCM8230_H_
#define _TCM8230_H_

/***********************************************************************/
/* Device Address on I2C                                               */
/***********************************************************************/
#define SLV_ADR_TCM8230 0x3C


/***********************************************************************/
/* Register Mapping                                                    */
/***********************************************************************/
#define TCM8230_CFG02	0x02
// default 0x40
// setting 0xC0 = FPS_15FPS | ACF_60HZ | DCLK_NORMAL | ACFDET_AUTO
#define FPS_30FPS		(0x00 << 7)
#define FPS_15FPS		(0x01 << 7)
#define ACF_50HZ        (0x00 << 6)
#define ACF_60HZ        (0x01 << 6)
#define DCLK_NORMAL     (0x00 << 1)
#define DCLK_REVERCE    (0x01 << 1)
#define ACFDET_AUTO     (0x00 << 0)
#define ACFDET_MANUAL   (0x01 << 0)

// default 0x80
// setting 0x00 = DOUT_ON | DOUT_OUT | SIZE_VGA | FORMAT_YUV422 | COLER_COLOR
#define TCM8230_CFG03	0x03
#define DOUT_ON         (0x00 << 7)
#define DOUT_OFF        (0x01 << 7)
#define DOUT_OUT        (0x00 << 6)
#define DOUT_HIZ        (0x01 << 6)
#define SIZE_VGA        (0x00 << 2)
#define SIZE_QVGA       (0x01 << 2)
#define SIZE_QVGAZ      (0x02 << 2)
#define SIZE_QQVGA      (0x03 << 2)
#define SIZE_QQVGAZ     (0x04 << 2)
#define SIZE_CIF        (0x05 << 2)
#define SIZE_QCIF       (0x06 << 2)
#define SIZE_QCIFZ      (0x07 << 2)
#define SIZE_SQCIF      (0x08 << 2)
#define SIZE_SQCIFZ     (0x09 << 2)
#define FORMAT_YUV422   (0x00 << 1)
#define FORMAT_RGB565   (0x01 << 1)
#define COLER_COLOR     (0x00 << 0)
#define COLER_B_W       (0x01 << 0)


#define TCM8230_LENS    0x1A

#endif/*_TCM8230_H_*/
